<template>
  <div>
    <!--测试题-->
    <div>
      <!--题目-->
      <van-cell-group inset>
        <van-cell :title="test.q" size="large"/>
      </van-cell-group>
      <!--回答-->
      <van-radio-group @change="changeRadio" v-model="radio" style="margin-top: 20px;margin-left: 25px;">
        <van-radio :name="test.ia" style="margin-bottom: 25px">{{ test.a }}
        </van-radio>
        <van-radio :name="test.ib">{{ test.b }}</van-radio>
      </van-radio-group>
    </div>
  </div>
</template>

<script>
export default {
  name: "MbtiQuestion",
  data() {
    return {
      radio: '0'
    }
  },
  methods: {
    //选择答案
    changeRadio(name) {
      this.$store.commit('RADIOBTN',1)
      this.$store.dispatch('answers',name)
    }
  },
  computed:{
    test(){
      return this.$store.state.mbtiTest
    }
  },


}
</script>

<style scoped>

</style>